<form id="<?php echo $uniqid;?>" method="post" style="padding: 8px;">
	<table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
	<input type="hidden" name="id" value="<?php echo $dataset->id;?>" />
	<table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
		<tr bgcolor="#FFFFFF">
			<td class="tlabel" style="line-height:30px;"  width="10%">标题：</td>
			<td colspan="5" width="90%"><input name="title" type="text" style="width:400px;"  value="<?php echo $dataset->title;?>" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入标题."  required="true"></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td  class="tlabel" >栏目：</td>
			<td class="main" >
			<?php echo $dataset->class;?>
			</td>
			<td class="tlabel">关键词：</td>
			<td colspan="3"><input name="keywords" type="text" style="width:400px;"  value="<?php echo $dataset->keywords;?>"  class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入关键词"></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td class="tlabel" >公司：</td>
			<td class="main"><input type="text" size="20" name="author" value="<?php echo $dataset->company->name;?>"  class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"  placeholder="请输入作者"></td>

			<td class="tlabel" >报价：</td>
			<td>
				<input type="text" size="20" name="author" value="<?php if($dataset->price){echo $dataset->price;}else{echo '请电话询价';}?>"  class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox">
			</td>

			<td class="tlabel" >点击数：</td>
			<td><input type="text" size="45" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"  placeholder="请输入"  name="copyfromurl" value="<?php echo $dataset->hits;?>" ></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td class="tlabel">排序：</td>
			<td class="main"><input type="text" name="sortorder" size="20"  class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"   value="<?php echo $dataset->sortorder;?>" /></td>
			<td class="tlabel">状态：</td>
			<td><label><?php echo $dataset->status==0?'待审核':($dataset->status==1?'审核通过':($dataset->status==2?'已推荐':'已删除'));?></label></td>
			<td class="tlabel" >推荐：</td>
			<td class="main"><label><input type="checkbox" name="recommend" class="textbox-prompt"  <?php if($dataset->recommend==1){echo "checked";}?> value="1" />设为推荐</label></td>
		</tr>
		<?php if($dataset->info->params):?>
		<tr bgcolor="#FFFFFF">
			<td class="tlabel">参数：</td>
			<td class="main" colspan="5">
			<p id="newseditlogo" class="gallery">
			<?php foreach($dataset->info->params as $v):?>
				<?php echo '<p>', $v->name, ':', $v->value, '</p>';?>
			<?php endforeach;?></div>
			</td>
		</tr>
		<?php endif;?>
		<tr bgcolor="#FFFFFF">
			<td style="line-height:30px;">内容：</td>
			<td colspan="5">
			<script id="newseditEditor" name="content" type="text/plain"><?php echo $dataset->info->detail;?></script>
			</td>
		</tr>
</table>
</form>
</div>

<script>
/***umeditor BOF***/
if(typeof(newseditum)!='undefined'){
	newseditum.destroy();
}
var newseditum = UM.getEditor('newseditEditor');
/***umeditor EOF***/

$('#productsSubmit').click(()=>{
	updateStatus(1);
});
$('#productsRecommend').click(()=>{
	updateStatus(2);
});
$('#productsDelete').click(()=>{
	updateStatus(3);
});
var updateStatus = function(status){
	$.post('/admin/products/newsedit', {db:'<?php echo $db?>',id:'<?php echo $id?>',status:status}, function (data) {
		if(data.ret == 0){
			$.messager.show({
				title:'提示',
				msg:data.msg,
				timeout:3000,
				showType:'slide'
			});
			$("#news").datagrid('reload');
			$("#newsdlg").dialog('close');
		}else{
			$.messager.alert('提示',data.msg,'warning');
		}
	}, 'JSON');
};

</script>
